from django.shortcuts import render
from rest_framework import serializers
from rest_framework import viewsets
from . import models

# Create your views here.

class RequestSerializers(serializers.ModelSerializer):
    
    class Meta:
        model = models.Request
        fields = "__all__"

class RequestViewSet(viewsets.ModelViewSet):
    queryset = models.Request.objects.all()
    serializer_class = RequestSerializers


class TestCaseSerializers(serializers.ModelSerializer):

    class Meta:
        model = models.TestCase
        fields = "__all__"

class TestCaseViewSet(viewsets.ModelViewSet):
    queryset = models.TestCase.objects.all()
    serializer_class = TestCaseSerializers

class HistorySerializers(serializers.ModelSerializer):

    class Meta:
        model = models.History
        fields = "__all__"

class HistoryViewSet(viewsets.ModelViewSet):
    queryset = models.History.objects.all()
    serializer_class = HistorySerializers

class ResourceSerializers(serializers.ModelSerializer):

    class Meta:
        model = models.Resource
        fields = "__all__"

class ResourceViewSet(viewsets.ModelViewSet):
    queryset = models.Resource.objects.all()
    serializer_class = ResourceSerializers

class AppSerializers(serializers.ModelSerializer):

    class Meta:
        model = models.App
        fields = "__all__"

class AppViewSet(viewsets.ModelViewSet):
    queryset = models.App.objects.all()
    serializer_class = AppSerializers